<?php
/*
 *author:Yangligao
 *Date:2013-9-26
 */
require '../../Config.php';
$flag = $_GET['flag'];
if($flag == 'display'){
	$smarty->display('Admin/CpM/cpinsert.html');
}else if($flag == 'cpinsert'){
	unset($_POST['x']);
	unset($_POST['y']);
	$upload = new Upload();
	$picPath = $upload->savePic("../Upload");
	$_POST['cp_pic'] = $picPath;
	printArr($_POST);
	
	$joinCpModel = new JoinCpModel();
	$res = $joinCpModel->joincp_insert($_POST);
	if($res){
		jump('操作成功！', $_SERVER['HTTP_REFERER']);
	}else{
		jump('操作失败！！', $_SERVER['HTTP_REFERER']);
	}	
}
?>
